package japavo.gui.general_ui;

import japavo.gui.MainFrame;
import japavo.gui.components.custom_table.CustomTable;
import japavo.trainer.VocabularyTrainer;

import javax.swing.GroupLayout;
import javax.swing.JPanel;
import javax.swing.JScrollPane;

/**
 *
 */
@SuppressWarnings("serial")
public class EditVocabularyBookPanel extends JPanel {

	/**********************************************************************************************
	 ************************************ DECLERATIONS ******************************************** 
	 *********************************************************************************************/
	private EditVocabularyBookTableModel model;
	private MainFrame mainFrame;
	private VocabularyTrainer trainer;

	/**********************************************************************************************
	 ************************************ CONSTRUCTORS ******************************************** 
	 *********************************************************************************************/
	/**
	 * 
	 */
	public EditVocabularyBookPanel(MainFrame mainFrame, VocabularyTrainer trainer) {
		this.mainFrame = mainFrame;
		this.trainer = trainer;
		
		model = new EditVocabularyBookTableModel(trainer.getActiveBook());
		CustomTable vocabularyTable = new CustomTable(model);
		JScrollPane pane = new JScrollPane(vocabularyTable);
		
		// ========== Layout ==========
		GroupLayout layout = new GroupLayout(this);
		setLayout(layout);
		
		// Horizontal
		layout.setHorizontalGroup(layout.createSequentialGroup()
			.addComponent(pane)
		);
		
		// Vertical
		layout.setVerticalGroup(layout.createSequentialGroup()
			.addComponent(pane)	
		);
		
	}
	
	/**********************************************************************************************
	 ************************************** FUNCTIONS ********************************************* 
	 *********************************************************************************************/

	/**********************************************************************************************
	 ********************************* GETTER AND SETTER ****************************************** 
	 *********************************************************************************************/
}
